<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="BurnDownGraph.aspx.cs" Inherits="BurnDownGraph" Title="Tackle - Burn Down Graph" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentHolder" runat="Server">
    <span style="font-size: x-small"></span>
    <table cellpadding="4" cellspacing="0" style="width: 98%">
        <tr>
            <td bgcolor="#e3eaeb" style="border-right: silver 1px ridge; border-top: silver 1px ridge;
                border-left: silver 1px ridge; border-bottom: silver 1px ridge" valign="top">
                <span style="font-size: x-small">Sprint: </span>
                <asp:DropDownList ID="ddSprintSelection" runat="server" AutoPostBack="True" DataSourceID="dsGetSprintNames"
                    DataTextField="SprintName" DataValueField="SprintID" Font-Size="X-Small" OnDataBound="ddSprintSelection_DataBound"
                    OnSelectedIndexChanged="ddSprintSelection_SelectedIndexChanged">
                </asp:DropDownList>
                <asp:Label ID="lblNoSprints" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                    ForeColor="Red" Text="There are no sprints available for this team to generate a burn down graph."></asp:Label></td>
        </tr>
        <tr>
            <td style="height: 8px">
            </td>
        </tr>
        <tr>
            <td>
                <rsweb:ReportViewer ID="repViewBurnDownGraph" runat="server" Font-Names="Verdana"
                    Font-Size="8pt" Height="480px" ShowDocumentMapButton="False" ShowFindControls="False"
                    ShowPageNavigationControls="False" ShowZoomControl="False" Width="835px">
                    <LocalReport ReportPath="BurnDownGraph.rdlc">
                        <DataSources>
                            <rsweb:ReportDataSource DataSourceId="dsBurnDownChart" Name="DataSet1_GenerateBurnDownChart" />
                            <rsweb:ReportDataSource DataSourceId="odsScrumTeamPrefs" Name="DataSet1_ScrumTeamPrefs" />
                        </DataSources>
                    </LocalReport>
                </rsweb:ReportViewer>
                &nbsp; &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                <rsweb:ReportViewer ID="repCumulativeTasks" runat="server" Font-Names="Verdana" Font-Size="8pt"
                    Height="480px" ShowFindControls="False" ShowPageNavigationControls="False" ShowZoomControl="False"
                    Width="835px" ShowDocumentMapButton="False">
                    <LocalReport ReportPath="CumulativeFlow.rdlc">
                        <DataSources>
                            <rsweb:ReportDataSource DataSourceId="dsCumulativeChart" Name="DataSet1_GenerateCumulativeFlowChart" />
                        </DataSources>
                    </LocalReport>
                </rsweb:ReportViewer>
                <asp:ObjectDataSource ID="odsCumulativeChart" runat="server" SelectMethod="GetData"
                    TypeName="DataSet1TableAdapters.GenerateCumulativeFlowChartTableAdapter" OldValuesParameterFormatString="original_{0}">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ddSprintSelection" Name="@SprintID" PropertyName="SelectedValue" />
                    </SelectParameters>
                </asp:ObjectDataSource>
                <asp:SqlDataSource ID="dsCumulativeChart" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
                    SelectCommand="GenerateCumulativeFlowChart" SelectCommandType="StoredProcedure">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue"
                            Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td>
            </td>
        </tr>
    </table>
    <asp:SqlDataSource ID="dsBurnDownChart" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
        SelectCommand="GenerateBurnDownChart" SelectCommandType="StoredProcedure">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddSprintSelection" DefaultValue="-1" Name="SprintID"
                PropertyName="SelectedValue" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:ObjectDataSource ID="odsScrumTeamPrefs" runat="server" SelectMethod="GetData"
        TypeName="DataSet1TableAdapters.ScrumTeamPrefsTableAdapter">
        <SelectParameters>
            <asp:SessionParameter Name="ScrumTeamID" SessionField="ScrumTeamID" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:SqlDataSource ID="dsGetSprintNames" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
        SelectCommand="SELECT tblSprint.SprintID, tblMasterBacklogSchedule.SprintName FROM tblMasterBacklogSchedule INNER JOIN tblSprint ON tblMasterBacklogSchedule.MasterBacklogScheduleID = tblSprint.fMasterBacklogScheduleID WHERE (tblMasterBacklogSchedule.fScrumTeamID = @ScrumTeamID) ORDER BY tblMasterBacklogSchedule.EndDate DESC">
        <SelectParameters>
            <asp:SessionParameter Name="ScrumTeamID" SessionField="ScrumTeamID" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>
